// Geometric Tools, Inc.
// http://www.geometrictools.com
// Copyright (c) 1998-2006.  All Rights Reserved
//
// The Wild Magic Library (WM3) source code is supplied under the terms of
// the license agreement
//     http://www.geometrictools.com/License/WildMagic3License.pdf
// and may not be copied or disclosed except in accordance with the terms
// of that agreement.

#ifndef WM3TRIMESH_H
#define WM3TRIMESH_H

#include "Wm3FoundationLIB.h"
#include "Wm3Geometry.h"
#include "Wm3IntArray.h"
#include "Wm3Triangle3.h"
#include "Wm3Triangles.h"

namespace Wm3
{

class WM3_ITEM TriMesh : public Triangles
{
    WM3_DECLARE_RTTI;
    WM3_DECLARE_NAME_ID;
    WM3_DECLARE_STREAM;

public:
    TriMesh (Vector3fArray* pkVertices, IntArray* pkIndices,
        bool bGenerateNormals, bool bCachedNormals = false);
    virtual ~TriMesh ();

    // Interpretation of the index buffer data.
    virtual int GetTriangleQuantity () const;
    virtual bool GetTriangle (int i, int& riV0, int& riV1, int& riV2) const;

protected:
    TriMesh ();
};

WM3_REGISTER_STREAM(TriMesh);
typedef Pointer<TriMesh> TriMeshPtr;
#include "Wm3TriMesh.inl"

}

#endif

